#!/usr/bin/perl

my @fields = qw{a b c};
print "@fields\n";

@fields = addItems(@fields);

print "-----\n";
print "@fields\n";
print "end\n";

#add elements into the input parameter, which is an array.
sub addItems
{
	my (@fields) = @_;
	
	for ( my $i = 0 ; $i < @fields ; $i++ )
	{
		print "$i\n";
		$fields[$i] = "" if not defined $fields[$i];
	}
	
	for ( my $i = @fields; $i <= 20; $i++)
	{
		print "$i\n";
		push @fields, "1";
	}
	
	return @fields;
}